package com.wm.task;

public class Store {
    private int goods = 1;

    public void sell(int customer) {

        synchronized(this) {
            if (goods <= 5) {
                System.out.println(goods + "号商品被" + customer + "号顾客秒杀");
                goods++;
            }
        }
    }
}
